package com.ruoyi.web.controller.shop.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.product.ShopProductAttributeDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface IBackShopProductAttrMapper extends BaseMapper<ShopProductAttributeDO> {

    @Delete("DELETE FROM shop_product_attribute WHERE id=#{attrId} and is_enable=0")
    int remove(Long attrId);

    @Select("SELECT id FROM shop_product_attribute WHERE attr_name=#{attrName} and shop_id=#{shopId} and is_delete=0")
    Long getIdByAttrName(@Param("shopId") Long shopId, @Param("attrName") String attrName);
}
